﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.ExportToRTR.YAML.CollisionRuleIgnore
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll


namespace DnProcessSimulateCommands.ExportToRTR.YAML;

public class CollisionRuleIgnore : CollisionRuleBase
{
  public CollisionSet IgnoreCollision;

  public CollisionRuleIgnore(string first = "complete_robot", string second = "complete_world")
  {
    this.IgnoreCollision = new CollisionSet((CollisionSetsBetweenBase) new CollisionSetsBetweenStatic(first, second));
  }

  public CollisionRuleIgnore(CollisionSetsBetweenBase between)
  {
    this.IgnoreCollision = new CollisionSet(between);
  }

  public override bool AlmostEquals(CollisionRuleBase other, double epsilon)
  {
    if (this.GetType() == other.GetType())
    {
      CollisionRuleIgnore collisionRuleIgnore = (CollisionRuleIgnore) other;
      if (this.IgnoreCollision != null && collisionRuleIgnore.IgnoreCollision != null)
        return this.IgnoreCollision.AlmostEquals(collisionRuleIgnore.IgnoreCollision, epsilon);
      if (this.IgnoreCollision == null && collisionRuleIgnore.IgnoreCollision == null)
        return true;
    }
    return false;
  }
}
